#ifndef BaseUtil_h
#define BaseUtil_h


template <typename T>
inline T *AllocArray(size_t n)
{
    return (T*)calloc(n, sizeof(T));
}

template <typename T>
inline T *AllocStruct()
{
    return (T*)calloc(1, sizeof(T));
}

template <typename T>
inline void Swap(T& one, T&two)
{
    T tmp = one; one = two; two = tmp;
}

#endif // BaseUtil_h